#ifndef CRATE_H_
#define CRATE_H_

#include "sceneObject.h"
#include "../actions/grabable.h"
#include "../actions/gravity.h"

class CrateView{
	public:
		CrateView(){}
		virtual ~CrateView(){}

		virtual void draw()=0;
};

class CrateViewA : public CrateView{
	private:
		static Vertexf vertices[];
		static const unsigned int nVertices = 8;

	public:
		CrateViewA(){}
		~CrateViewA(){}

		static CrateView& instance(){
			static CrateViewA i;
			return i;
		}

		void draw();
};

class CrateViewB : public CrateView{
	private:
		static Vertexf vertices[];
		static const unsigned int nVertices = 8;

	public:
		CrateViewB(){}
		~CrateViewB(){}

		static CrateView& instance(){
			static CrateViewB i;
			return i;
		}

		void draw();
};

class CrateViewC : public CrateView{
	private:
		static Vertexf vertices[];
		static const unsigned int nVertices = 8;

	public:
		CrateViewC(){}
		~CrateViewC(){}

		static CrateView& instance(){
			static CrateViewC i;
			return i;
		}

		void draw();
};

class Crate : public SceneObject , public Grabable , public Solid{
	private:
		CrateView& view;
		bool grabbed;

	public:
		Crate(Rectangle rec,CrateView& view);
		~Crate();

		void draw();
		void move(float dx,float dy);

		void setGrabbed(bool grabbed){
			this->grabbed=grabbed;
		}

		void timeStep();

		static std::string name(){
			return "crate";
		}

		void notifyCollision(Solid* obj){}
};

#endif /* CRATE_H_ */
